import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    user: JSON.parse(window.localStorage.getItem('123')),
    uname: JSON.parse(window.localStorage.getItem('hh'))
  },
  mutations: {
    setUser (state, str) {
      state.user = str
      window.localStorage.setItem('123', JSON.stringify(state.user))
    },
    setUname (state, un) {
      state.uname = un
      window.localStorage.setItem('hh', JSON.stringify(state.uname))
    }
  },
  actions: {
  },
  modules: {
  }
})
